<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title>个人资料</title>
		<link rel="stylesheet" href="__PUBLIC__/Home/css/common.css">
		<link rel="stylesheet" href="__PUBLIC__/Home/css/main.css">
		<script type="text/javascript" src="__PUBLIC__/Home/js/jquery-1.8.3.min.js"></script>
		<script src="__PUBLIC__/Home/js/zepto.js"></script>
		<script type="text/javascript" src="__PUBLIC__/Home/js/ajaxfileupload.js"></script>
		<script src="__PUBLIC__/Home/js/delIOS_huitan.js"></script>
		<script>
			function ajaxFileUpload(){
				$.ajaxFileUpload({
						url: "{:U('Index/uploadimg')}", //用于文件上传的服务器端请求地址
						secureuri: false, //一般设置为false
						fileElementId: 'img', //文件上传空间的id属性  <input type="file" id="file" name="file" />
						dataType: 'json', //返回值类型 一般设置为json
						success: function (data){
							window.location.reload();
							//$(".con").css('background',data.img);
						},
						error: function (data, status, e){
							//alert(data);
						}
					});
				return false;
			}
		</script>
	</head>
	<body class="box">
		<!--遮罩层-->
		<div id="zhezhao" style="display:none"></div>
		<!--更改头像 弹出的底部框-->
		<div id="gerenGaiTouxiang" class="botKuang2Area" style="display: none">
			<div class="contain maxWidth">
				<div class="operate">
					<ul>
						<li><a href="javascript:;">拍照</a></li>
						<li><a href="javascript:;">我的相册</a></li>
					</ul>
				</div>
				<div class="cancel">
					<a href="javascript:;">取消</a>
				</div>
			</div>
		</div>
		<!--正文区域-->
		<div id="gerenZiliaoTop" class="topBackTitle">
			<div class="contain maxWidth">
				<a class="hz back" href="javascript:;">&#xe600;</a>个人资料
			</div>
		</div>
		<div id="gerenZiliaoMain" class="fastscroll top50bot0">
			<div class="contain maxWidth">
				<ul class="ullist1line">
					<li class="h70">
						<a href="javascript:;"> 
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe622;</span>
								</span><em>头像</em>
							</div>
							<div class="right txInput">
								<if condition="$user.image neq ''">
								<span class="img con" style="background-image:url({$user.image})"></span>
								<else/>
								<span class="img con" style="background-image:url(__PUBLIC__/Home/img/mytouxiang.png)"></span>
								</if>
								<input type="file" id="img" name="img" accept="video/*;capture=camcorder" onchange="ajaxFileUpload()">
								<span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					<li>
						<a href="{:U('Index/edit',array('type'=>0))}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe623;</span>
								</span><em>姓名</em>
							</div>
							<div class="right">
								<span class="con">{$user.name}</span><span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					<li class="sex">
						<a href="javascript:;">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe620;</span>
								</span><em>性别</em>
							</div>
							<div class="right">
								<span class="con">{$sexarr[$user['sex']]}</span><span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					<li>
						<a href="{:U('Index/upmobile')}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe621;</span>
								</span><em>修改手机号</em>
							</div>
							<div class="right">
								<span class="con">{$user.mobile}</span><span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					
					<li>
						<a href="{:U('Index/editpass')}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe61f;</span>
								</span><em><if condition="$user.login_pass neq ''">修改密码<else/>设置密码</if></em>
							</div>
							<div class="right">
								<span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					
					<li>
						<a href="{:U('Index/editpaypwd')}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe61f;</span>
								</span><em>余额支付密码</em>
							</div>
							<div class="right">
								<span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					<li>
						<a href="{:U('UserAddress/index')}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe60d;</span>
								</span><em>收货地址</em>
							</div>
							<div class="right">
								<span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li>
					<!-- <li>
						<a href="{:U('Index/edit',array('type'=>1))}">
							<div class="left">
								<span class="icon">
									<span class="hz">&#xe624;</span>
								</span><em>邮编号码</em>
							</div>
							<div class="right">
								<span class="con">{$user.zip_code}</span><span class="hz">&#xe60c;</span>
							</div>
						</a>
					</li> -->
				</ul>
			</div>
		</div>

		<script>
			//返回按钮
			$('#gerenZiliaoTop .back').on('tap',function(){
				//window.history.go(-1);
				window.location.href='{:U('Index/index')}';
			});

			//获取参数
			var sexstr=[null,'男','女'];
			var hrefstr=location.href;
			if(hrefstr.indexOf('sex=')!=-1){
				var num=hrefstr.substring(hrefstr.indexOf('sex=')+4);
				$('#gerenZiliaoMain .ullist1line li.sex .right .con').text(sexstr[num]);
			}

			//点击 性别 跳转到性别页面  男1 女2
			$('#gerenZiliaoMain .ullist1line li.sex').on('tap',function(){
				var text=$(this).find('.right .con').text();
				var num=null;
				if(text=='男'){
					num=1;
				}else if(text=='女'){
					num=2;
				}
				location.href='{:U('Index/sex')}&sex='+num;
				//location.href='我的个人资料修改性别.html?sex='+num;
			});
		</script>
	</body>
</html>
